﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
/*
using GMap.NET;
using GMap.NET.MapProviders;
using GMap.NET.WindowsForms;

 * */
using System.Threading;

namespace LedCenter.GUI
{
    public partial class DevicesPanel : UserControl
    {
        //GMapOverlay overlayOne;
        String contry;

        public DevicesPanel()
        {
            InitializeComponent();
        }

        private void gMapControl_Load(object sender, EventArgs e)
        {
            //return;
            /*
            (new Thread(() =>
            {
                if (this.InvokeRequired)
                {
                    this.Invoke(new dlgPopulateMap(populateMap));
                }
                else

             * 
             * {

                    populateMap();
                }
            })).Start();
            
            dlgPopulateMap d = new dlgPopulateMap(populateMap);
            _ia = d.BeginInvoke(null, null);
             * */
            //populateMap();
            //Invalidate();
        }
        /*
        private delegate void dlgPopulateMap();
        IAsyncResult _ia = null;
        private void populateMap()
        {
            if (this.InvokeRequired)
                this.BeginInvoke(new Action(populateMap));
            else
            {
                gMapControl.Position = new PointLatLng(21.029151, 105.785894);
                gMapControl.MapProvider = GMapProviders.GoogleMap;
                gMapControl.MinZoom = 8;
                gMapControl.MaxZoom = 17;
                gMapControl.Zoom = 13;
                gMapControl.Manager.Mode = AccessMode.ServerAndCache;
                //ajout des overlay
                overlayOne = new GMapOverlay(gMapControl, "OverlayOne");
                //ajout de Markers
                overlayOne.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(new PointLatLng(21.029151, 105.785894)));
                //ajout de overlay la map
                gMapControl.Overlays.Add(overlayOne);
            }
        }
         * */
    }
}
